/****************************************************************/
/*                        Instruction                           */
/* This is the Material applying the necessary parameters      */
/* to simulate heat conduction and pyrolysis progress .         */
/* the pyrolysis model is Arrhenius relation(pyrolysis area,not surface model) .         */
/* the first version did not include pyrolysis gas properties(created at 2017.02.24)         */

#pragma once

#include "Material.h"
#include "LinearInterpolation.h"

class Function;

class MUltiPhasePyrolysisMaterial : public Material
{
public:
	MUltiPhasePyrolysisMaterial(const InputParameters & parameters);

protected:

    virtual void initQpStatefulProperties();
    virtual void computeQpProperties();
//   MaterialProperty<PropertyPack> & _property_pack;
   MaterialProperty<Real> & _epsilon;
   MaterialProperty<Real> & _sigma;
   MaterialProperty<Real> & _R;//气体常数
   MaterialProperty<Real> & _kv;
   MaterialProperty<Real> & _kc;
   MaterialProperty<Real> & _ks;
   MaterialProperty<Real> & _cpv;
   MaterialProperty<Real> & _cpc;
   MaterialProperty<Real> & _cps;
   MaterialProperty<Real> & _hv;
   MaterialProperty<Real> & _hc;
   MaterialProperty<Real> & _hs;
   MaterialProperty<Real> & _rhov;
   MaterialProperty<Real> & _rhoc;
   MaterialProperty<Real> & _pyrolysis_heat;
   MaterialProperty<Real> & _porosity_v;
   MaterialProperty<Real> & _porosity_c;
   MaterialProperty<Real> & _porosity;
   MaterialProperty<Real> & _permeability_v;
   MaterialProperty<Real> & _permeability_c;
   MaterialProperty<Real> & _permeability;
   MaterialProperty<Real> & _char_percent;
   const MaterialProperty<Real> & _rhos;
   const VariableValue  & _T_value;
   const VariableGradient &  _gradient_T_value;
  //get Regular thermal properties
  Real _epsilon_value;
  Real _R_value;
  LinearInterpolation  _func_kv_T;
  LinearInterpolation  _func_kc_T;
  LinearInterpolation  _func_cpv_T;
  LinearInterpolation  _func_cpc_T;
  LinearInterpolation  _func_hv_T;
  LinearInterpolation  _func_hc_T;
  std::vector<Real>  _kvT_list; //to get T list of kv
  std::vector<Real>  _kv_list; //to get list of kv
  std::vector<Real>  _kcT_list;//to get T list of kc
  std::vector<Real>  _kc_list;//to get list of kc
  std::vector<Real>  _cpvT_list;//to get T list of cpv
  std::vector<Real>  _cpv_list;//to get list of cpv
  std::vector<Real>  _cpcT_list;//to get T list of cpc
  std::vector<Real>  _cpc_list;//to get list of cpc
  std::vector<Real>  _hvT_list; //to get T list of hv
  std::vector<Real>  _hv_list; //to get list of hv
  std::vector<Real>  _hcT_list;//to get T list of hc
  std::vector<Real>  _hc_list;//to get list of hc

  Real  _rhov_value;
  Real  _rhoc_value;
  //get special parameters to compute pyrolysis Arrhenius relation
  Real  _pyrolysis_heat_value;
  //get porous media parameters
  Real  _porosity_v_value;
  Real  _porosity_c_value;
  Real  _permeability_v_value;
  Real  _permeability_c_value;






};

template<>
InputParameters validParams<MUltiPhasePyrolysisMaterial>();
